package com.zzzyh.forumsystemclient.dao;

import com.zzzyh.forumsystemclient.model.ChatMsg;
import com.zzzyh.forumsystemclient.model.ChatRoom;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ChatMsgMapper {
    int insert(ChatMsg row);

    int insertSelective(ChatMsg row);

    ChatMsg selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ChatMsg row);

    int updateByPrimaryKeyWithBLOBs(ChatMsg row);

    int updateByPrimaryKey(ChatMsg row);

    List<ChatMsg> list(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize, @Param("roomId") Integer roomId);

    Integer total();


    List<Integer> getFriendsList(@Param("userId")Integer userID);

    List<Integer> getRoomsIdList(Integer userID);

    List<ChatRoom> getRooms(@Param("roomsId") List<Integer> roomsId);

    ChatMsg getLastMsg(Long roomId);

    Integer getRoomIdWithFriend(@Param("userId") Integer userId, @Param("friendId") Integer friendId);

    void recallMsg(Integer id);

    Integer getUnreadCount(@Param("roomId") Long roomId, @Param("userId") Integer userId);

    List<Integer> getAdminFriendsList();

}